function toggle(ids) {
var ele = document.getElementById(ids);
if (ele.style.display == "block") { ele.style.display = "none"; }
else { ele.style.display = "block"; }
} 

function toggle2(ids) {
var ele = document.getElementById(ids);
if (ele.style.display == "none") { ele.style.display = "block"; }
else { }
}

function toggle3(ids) {
var ele = document.getElementById(ids);
if (ele.style.display == "block") { ele.style.display = "none"; }
else { }
} 

function toggleSpan(field, word){
document.getElementById(field).innerHTML = word;
}

function toggleMenu2(one, two) {
  toggle2(one);
  toggle3(two);
}

function toggleSpan(field, word){
document.getElementById(field).innerHTML = word;
}

function autoInsert(ids, data) {
if (document.getElementById(ids).innerHTML == '') { document.getElementById(ids).innerHTML = data; }
}
function autoInsert2(targetarea, sourcediv, add) {
	if ($("#"+targetarea).val() == '') { 
		var data = $('#'+sourcediv).html();
		if (add) data = data + add; 
		$("#"+targetarea).html(data);
	}
}
function autoInsertMain(ids, data) {
	document.getElementById(ids).innerHTML = data;
}

function getSelText(ids)
{
    var txt = '';
	textObj = document.getElementById(ids)
	
     if (window.getSelection)
    {
        txt = window.getSelection();
             }
    else if (document.getSelection)
    {
        txt = document.getSelection();
            }
    else if (document.selection)
    {
        txt = document.selection.createRange().text;
            }
    else return;
	
textObj.value =  txt;
}

function changeClass(ids, classed){
	document.getElementById(ids).setAttribute("class", classed);
}